class ApiRouter {
  ApiRouter._();
  static const env = String.fromEnvironment('env');

  static const clientVersion = String.fromEnvironment('client-version');

  /// 家庭内网网络
  /// 8081 HTTP
  /// 9999 WS
  //static const String localHost = "192.168.31.232";

  /// 办公室网络
  static const String localHost = "192.168.20.104";

  static String getHttpServer() {
    // 默认家庭环境
    String httpServerPath;
    String serverEnv = env == "" ? "prod" : env;
    switch (serverEnv) {
      case 'test':
        httpServerPath = "http://192.168.20.104:8081/Xpocker/";
      case 'dev':
        httpServerPath = "http://192.168.31.232:8081/Xpocker/";
      case 'prod':
        httpServerPath = "https://xplay3000.cn:30008/Xpocker/";
      default:
        httpServerPath = "https://xplay3000.cn:30008/Xpocker/";
        break;
    }
    return httpServerPath;
  }

  static String getSocketServer() {
    // 默认家庭环境
    String socketServerPath;
    String serverEnv = env == "" ? "prod" : env;
    switch (serverEnv) {
      case 'test':
        socketServerPath = "ws://192.168.20.104:9999/ws";
        break;
      case 'dev':
        socketServerPath = "ws://192.168.31.232:9999/ws";
        break;
      case 'prod':
        socketServerPath = "wss://xplay3000.cn:30008/wss";
        break;
      default:
        socketServerPath = "wss://xplay3000.cn:30008/wss";
        break;
    }
    return socketServerPath;
  }

  /// 家庭宽带网络
  /// 30008 HTTP
  /// 30009 WS
  // static const String localHost = "xplay3000.cn";

  // 代理双SS
  /* static const String localHostHttp = "https://xplay3000.cn:30008/Xpocker/";
  static const String wsUrl = "wss://xplay3000.cn:30008/wss";*/
  // 文件路径
  static final String filePath = "${ApiRouter.getHttpServer()}open/api/file/";

  // 验证码接口
  static const String verificationCode = "verification/generateCode";

  // 验证码接口
  static const String verificationCheckCode = "verification/checkGenerateCode";

  // 用户登录接口
  static const String login = "/system/login";

  // 用户创建接口
  static const String userCreate = "/system/create";

  // 用户信息更新接口
  static const String userUpdate = "/system/update";

  // 文件上传接口
  static const String uploadFile = "/system/upload/";

  //房间创建接口
  static const String createRoom = "/room/create";

  //获取房间接口
  static const String getRoom = "/room/get";

  //加入房间接口
  static const String addRoom = "/room/add";

  //退出房间
  static const String exitRoom = "/room/exit";

  //读取房间数据接口
  static const String readRoom = "/room/read";
  static const String roomMessage = "/room/message";
// 设置用户挂机
  static const String userHook = "/user/hook";

  //历史战绩
  static const String historyRecode = "/recode/history/page";
  static const String historyRecodeList = "/recode/history/list";
  static const String historyRecodeInfo = "/recode/history/info";
}
